//
//  ViewController.m
//  04-Homework
//
//  Created by dllo on 16/7/19.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "ViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatQQMusic];
}
- (void)creatQQMusic {
   
    // 背景
    UIImageView * imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vc_bg"]];
    imageview.userInteractionEnabled = YES;
    imageview.contentMode = UIViewContentModeScaleAspectFit;
    imageview.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    [self.view addSubview:imageview];
    // 左Button
    UIButton *btnLeft = [UIButton buttonWithType:UIButtonTypeCustom];
    btnLeft.frame = CGRectMake(20, 20, 50, 40);
    [btnLeft setImage:[UIImage imageNamed:@"xiangxia"] forState:UIControlStateNormal];
    [self.view addSubview:btnLeft];
    // 右Button
    UIButton *btnRight = [UIButton buttonWithType:UIButtonTypeCustom];
    btnRight.frame = CGRectMake(WIDTH - 70, 20, 50, 40);
    [btnRight setImage:[UIImage imageNamed:@"Unknown"] forState:UIControlStateNormal];
    [self.view addSubview:btnRight];
    
    // 歌名
    UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 2 - 30, 30, 80, 40)];
    labelTitle.text = @"潮汐";
    labelTitle.textColor = [UIColor whiteColor];
    labelTitle.font = [UIFont systemFontOfSize:30];
    [self.view addSubview:labelTitle];
    // 作者
    UILabel *labelName = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 2 - 60, 80, 130, 40)];
    labelName.text = @"__  齐浠儿  __";
    labelName.textColor = [UIColor whiteColor];
    labelName.font = [UIFont systemFontOfSize:20];
    [self.view addSubview:labelName];
    // 标准
    UIImageView *imageNorm = [[UIImageView alloc]initWithFrame:CGRectMake(100, 140, 70, 32)];
    imageNorm.image = [UIImage imageNamed:@"player_btn_sq_sel_normal"];
    [self.view addSubview:imageNorm];
    // MV
    UIImageView *imageMV = [[UIImageView alloc] initWithFrame:CGRectMake(180, 140, 70, 32)];
    imageMV.image = [UIImage imageNamed:@"player_btn_mv_normal"];
    [self.view addSubview:imageMV];
    // Dts
    UIImageView *imageDts = [[UIImageView alloc] initWithFrame:CGRectMake(260, 140, 70, 32)];
    [imageDts setImage:[UIImage imageNamed:@"player_btn_dts_on"]];
    [self.view addSubview:imageDts];
    // 照片
    UIImageView *imagePhoto = [[UIImageView alloc] initWithFrame:CGRectMake(50, 185, 280, 280)];
    [imagePhoto setImage:[UIImage imageNamed:@"u=150292746,1514730549&fm=21&gp=0"]];
//    self.centerImage.frame = CGRectMake(10, 100, WIDTH - 20, WIDTH - 20);
//    self.centerImage.layer.cornerRadius = (WIDTH - 20) / 2;
    
    imagePhoto.layer.cornerRadius = 140;
    imagePhoto.layer.masksToBounds = YES;
    [self.view addSubview:imagePhoto];
    // 歌词
    UILabel *labelParoles = [[UILabel alloc] initWithFrame:CGRectMake(80, 470, 250, 35)];
    labelParoles.text = @"下一次还会始终凝望着你";
    labelParoles.textColor = [UIColor whiteColor];
    labelParoles.font = [UIFont systemFontOfSize:20];
    [self.view addSubview:labelParoles];
    // UIPageControl
    UIPageControl *page = [[UIPageControl alloc] initWithFrame:CGRectMake(150, 515, 80, 40)];
    page.numberOfPages = 3;
    page.currentPage = 0;
    page.hidesForSinglePage = YES;
    [self.view addSubview:page];
    // UISlider
    UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(65, 565, WIDTH - 130, 50)];
    slider.value = 0.5f;
    slider.minimumValue = 0.0f;
    slider.maximumValue = 1.0f;
    slider.minimumTrackTintColor = [UIColor colorWithRed:0.13 green:0.76 blue:0.49 alpha:1.00];
    slider.thumbTintColor = [UIColor colorWithRed:0.13 green:0.76 blue:0.49 alpha:1.00];
    [self.view addSubview:slider];
    // 后退(recede) 前进(Forward) 停止/播放(play)
    UIButton *btnRecede = [UIButton buttonWithType:UIButtonTypeCustom];
    btnRecede.frame = CGRectMake(250, 630, 60, 60);
    [btnRecede setImage:[UIImage imageNamed:@"player_btn_next_normal"] forState:UIControlStateNormal];
    [self.view addSubview:btnRecede];
    UIButton *btnForward = [UIButton buttonWithType:UIButtonTypeCustom];
    btnForward.frame = CGRectMake(100, 630, 60, 60);
    [btnForward setImage:[UIImage imageNamed:@"player_btn_pre_highlight"] forState:UIControlStateNormal];
    [self.view addSubview:btnForward];
    UIButton *btnPlay = [UIButton buttonWithType:UIButtonTypeCustom];
    btnPlay.frame = CGRectMake(165, 620, 80, 80);
    [btnPlay setImage:[UIImage imageNamed:@"player_btn_pause_normal"] forState:UIControlStateNormal];
    [self.view addSubview:btnPlay];
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 565, 50, 50)];
    label1.textColor = [UIColor grayColor];
    label1.text = @"00.36";
    [self.view addSubview:label1];
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH - 60, 565, 50, 50)];
    label2.text = @"03.26";
    label2.textColor = [UIColor grayColor];
    [self.view addSubview:label2];
    
    // 喜欢
    UIButton *btnLove = [UIButton buttonWithType:UIButtonTypeCustom];
    btnLove.frame = CGRectMake(60, 670, 70, 70);
    [btnLove setImage:[UIImage imageNamed:@"player_btn_favorited_normal"] forState:UIControlStateNormal];
    [self.view addSubview:btnLove];
    // 播放方式 playing mode
    UIButton *btnplaying = [UIButton buttonWithType:UIButtonTypeCustom];
    btnplaying.frame = CGRectMake(130, 670, 70, 70);
    [btnplaying setImage:[UIImage imageNamed:@"player_btn_repeat_disable"] forState:UIControlStateNormal];
    [self.view addSubview:btnplaying];
    // 下载
    UIButton *btnDownload = [UIButton buttonWithType:UIButtonTypeCustom];
    btnDownload.frame = CGRectMake(200, 670, 70, 70);
    [btnDownload setImage:[UIImage imageNamed:@"player_btn_share_normal"] forState:UIControlStateNormal];
    [self.view addSubview:btnDownload];
    // 历史 History
    UIButton *btnHistory = [UIButton buttonWithType:UIButtonTypeCustom];
    btnHistory.frame = CGRectMake(280, 670, 70, 70);
    [btnHistory setImage:[UIImage imageNamed:@"player_btn_playlist_normal"] forState:UIControlStateNormal];
    [self.view addSubview:btnHistory];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
